{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    // Valid `device` names are listed here: https://www.segger.com/supported-devices/jlink/st/stm32wl
    "version": "0.2.0",
    "configurations": [
        {
            "name": "STM32F401-Disco Debug",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/zephyr/zephyr.elf",
            "args": [],
            "cwd": "${workspaceRoot}",
            "MIMode": "gdb",
            "miDebuggerPath": "arm-zephyr-eabi-gdb",
            "miDebuggerServerAddress": ":3333",
            "useExtendedRemote": true,
            "debugServerPath": "openocd",
            "debugServerArgs": "-s ${config:zephyr_sdk_path}/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts -s ${workspaceFolder}/boards/arm/${config:board}/support -f openocd.cfg",
            "serverStarted": "Listening on port [0-9]+ for gdb connections",
            "filterStderr": true,
            "filterStdout": false,
            "launchCompleteCommand": "None",
            "postRemoteConnectCommands": [
                {
                    "description": "Hard Reset and Immediately Halt",
                    "text": "monitor reset halt",
                    "ignoreFailures": false
                },
                {
                    "description": "Flush Internal Register Cache",
                    "text": "flushregs",
                    "ignoreFailures": false
                },
                {
                    "description": "Shutdown GDB Server on GDB Detach",
                    "text": "monitor [target current] configure -event gdb-detach { shutdown }",
                    "ignoreFailures": false
                },
            ],
            "stopAtConnect": false,
            "logging": {
                "exceptions": true,
                "engineLogging": false,
                "moduleLoad": true,
                "programOutput": true,
                "trace": true,
                "traceResponse": false
            }
        }
    ]
}
